package com.property.cleaning.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 任务实体类
 * 
 * @author Property Cleaning System
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cleaning_tasks")
@ApiModel(value="CleaningTask对象", description="任务表")
public class CleaningTask {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "任务编码")
    @TableField("task_code")
    private String taskCode;

    @ApiModelProperty(value = "所属计划ID")
    @TableField("plan_id")
    private Long planId;

    @ApiModelProperty(value = "区域ID")
    @TableField("area_id")
    private Long areaId;

    @ApiModelProperty(value = "任务名称")
    @TableField("task_name")
    private String taskName;

    @ApiModelProperty(value = "任务描述")
    @TableField("task_description")
    private String taskDescription;

    @ApiModelProperty(value = "分配保洁员")
    @TableField("assigned_cleaner")
    private Long assignedCleaner;

    @ApiModelProperty(value = "任务日期")
    @TableField("task_date")
    private LocalDate taskDate;

    @ApiModelProperty(value = "开始时间")
    @TableField("start_time")
    private LocalTime startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")
    private LocalTime endTime;

    @ApiModelProperty(value = "预计时长(分钟)")
    @TableField("estimated_duration")
    private Integer estimatedDuration;

    @ApiModelProperty(value = "实际时长(分钟)")
    @TableField("actual_duration")
    private Integer actualDuration;

    @ApiModelProperty(value = "任务状态：1未开始 2进行中 3已完成 4异常")
    @TableField("task_status")
    private Integer taskStatus;

    @ApiModelProperty(value = "优先级：1低 2中 3高 4紧急")
    @TableField("priority")
    private Integer priority;

    @ApiModelProperty(value = "是否需要检查：1是 0否")
    @TableField("check_required")
    private Integer checkRequired;

    @ApiModelProperty(value = "附件路径(JSON)")
    @TableField("attachments")
    private String attachments;

    @ApiModelProperty(value = "备注")
    @TableField("notes")
    private String notes;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableField(exist = false)
    private String areaName;

    @TableField(exist = false)
    private String planName;

    @TableField(exist = false)
    private String cleanerName;

    @TableField(exist = false)
    private String statusName;

    @TableField(exist = false)
    private String priorityName;
}